<style scoped>
.btns .el-button:last-child {
  margin-left: 0;
}
</style>
<template>
  <div>
    <div class="btns">
      <!-- {{news}} -->
      <!-- {{tag}} -->
      <el-button @click="nowTag">现有确诊</el-button>
      <el-button @click="allTag">累计确诊</el-button>
    </div>
    <!-- tag_1可将tag的值传输给Map.vue -->
    <Map :tag_1="tag"></Map>
  </div>
</template>

<script>
import Map from "../../components/Map";
import axios from "@/http/axios";
// import Map from ''
export default {
  components: {
    Map,
  },

  data() {
    return {
      //   0->现有确诊
      //   1->累计确诊
      tag: 0,
      news:{},
    };
  },
  created(){
    this.findJson();
  },
  methods: {
    //第三方代理
    findJson(){
      axios.defaults.baseURL = 'http://localhost:9528'
      axios.get('/test/news/wap/fymap2020_data.d.json').then((res)=>{
        this.news=res.data;
        console.log(res.data)
      })
    },
    nowTag() {
      this.tag = 0;
    },
    allTag() {
      this.tag = 1;
    },
  },

};
</script>
